#ifndef  c12_T2_String_H_
#define c12_T2_String_H_

#include <iostream>
using std::ostream;
using std::istream;

class String
{
private:
	char * _str;	//pointer to string
	int _len;	//length of string
	static int _s_num_strings;		//number of objects
public:
	static const int CINLIM = 80;	//cin input limit

	String();	//default constructor
	String(const char * s);	//constructor
	String(const String &);   //copy constructor
	~String();		//destructor
	inline int Length() const { return _len; }
	
	//overloaded operator methods
	String & operator =(const String &);
	String & operator = (const char *);
	char & operator [] (int i);
	const char & operator [] (int i) const;

	//overloaded operator friends
	friend bool operator < (const String &st, const String &st2);
	friend bool operator > (const String &st1, const String &st2);
	friend bool operator == (const String &st, const String &st2);
	friend ostream & operator << (ostream & os, const String & st);
	friend istream & operator >> (istream & is, const String & st);

	//static function
	static int HomMany();

};

#endif